home *** CD-ROM | disk | FTP | other *** search
-
-
- ' Tag Environment subsystem:
- '
- ' Contributed by:
- ' Tom Dacon, 71062,426
- ' Dacon Software Consulting
- ' 3924 Park Place #3
- ' Montrose, CA 91020
- '
- ' Free. Public domain.
- '
- ' This posting contains
- ' read.me - this ASCII file
- ' tagenv.bas - implements the functionality
- ' strtok.bas - required support routine
- ' tagenv.mak, etc. - testbed VB project illustrating usage
- '
- '
- ' This set of routines provides support for tagged string fields
- ' in a VB Form or Control Tag property.
- '
- ' The Tag property, under this support, consists of a string
- ' of keyword=value pairs, delimited by semicolons; for instance,
- ' the following might be a tag string:
- '
- ' formname=myForm;MyName=Tom Dacon;My Full Name=Thomas A. Dacon
- '
- ' You delete a string from a tagged string field by setting it
- ' to a null string, just like the SET command in DOS.
- '
- ' Keywords and contents fields are stored in mixed case, as supplied,
- ' but searches for keywords are case-insensitive.
-
-
- ' The Application Programmer's Interface (API):
- '
- ' SetFormTagString form, key$, contents$
- ' GetFormTagString form, key$, contents$
- '
- ' SetCtlTagString control, key$, contents$
- ' GetCtlTagString control, key$, contents$
-
- '
- ' Unfortunately, there have to be different routines for Forms and
- ' Controls, since they are represented as different data types; if
- ' I'd written this as a DLL I suppose I could have handled the problem
- ' but I didn't know how to write custom controls then.
- '
- ' Imbedded blanks are OK in both the key and value fields; leading
- ' and trailing blanks are removed before storing the strings, so of
- ' course they do not appear when the string is retrieved.
-
- ' The delimiter between key and value pairs is the semicolon; so you
- ' have to guard yourself against using a key or value string that itself
- ' contains a semicolon. Or change the delimiter. Or write a better
- ' parser (copy me if you do).
- '
- ' Double quotes around the value string are stored in the Tag property,
- ' but stripped before the string is returned to the caller of Get...().
- ' I don't remember now why I put this in, but there it is; what's a
- ' mother to do?
-
- ' The StrTok$() function used herein is the same one I've posted
- ' separately, for someone who needed to parse simple strings.
-
-